<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta charset="utf-8">
    <title>图书管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/AdminLTE.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/pagination.css">
    <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/js/pagination.js"></script>
    <script src="${pageContext.request.contextPath}/js/my.js"></script>
</head>
<body class="hold-transition skin-red sidebar-mini">
<!-- .box-body -->
<div class="box-header with-border">
    <h3 class="box-title">图书评论</h3>
</div>
<div class="box-body">
    <%--新增按钮：如果当前登录用户是管理员，页面展示新增按钮--%>
    <div class="table-box">
        <!-- 数据表格 -->
        <table id="dataList" class="table table-bordered table-striped table-hover dataTable text-center">
            <thead>
            <tr>
                <th class="sorting_asc">图书名称</th>
                <th class="sorting">图书作者</th>
                <th class="sorting">评论内容</th>
                <th class="sorting">评论时间</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${pageResult.rows}" var="bookandcomment">
                <tr>
                    <td> ${bookandcomment.book.name}</td>
                    <td>${bookandcomment.book.author}</td>
                    <td>${bookandcomment.comments.comment_content}</td>
                    <td>${bookandcomment.comments.comment_date}</td>


            </c:forEach>
            </tbody>

        </table>
        <c:if test="${empty pageResult.rows}">
            <h1 align="center">暂无人评论！！！</h1>
        </c:if>
    </div>
</div>

</body>

</html>